home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14708 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  882 b 

  1. Path: newsfeeds.ans.net!btco!newsadm
  2. From: Shalom Reich <sqr1874@acf4.nyu.edu>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Proper use of friend keyword
  5. Date: Mon, 01 Apr 1996 10:49:08 -0500
  6. Organization: Bankers Trust Company
  7. Message-ID: <315FFAF4.667B@acf4.nyu.edu>
  8. References: <4jn3qk$3tl6@holly.ACNS.ColoState.EDU>
  9. NNTP-Posting-Host: algsvw0058.btco.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0GoldB1 (WinNT; I)
  14.  
  15. The friend declaration in a class allows the named (external) class or 
  16. function to access private members of the declaring class.  In your 
  17. example, ABC::GetAValue() will be able to access members of XYZ.  
  18.  
  19. Your main routine seems to be coded as if you wanted the 
  20. ABC::GetAValue() function to become part of the XYZ interface.  
  21. Friend will not accomplish that.
  22.  
  23. Hope this helps.
  24.  
  25. Shalom Reich
  26.